Holds all information for a script. More...
Public Member Functions | |
Script () | |
~Script () | |
INTERPRETER | getScriptType () const |
std::string_view | getName () const |
std::string_view | getSources () const |
const CompilationResult & | getLastCompilationResult () const |
void | setScriptFor (INTERPRETER interpretType) |
void | setName (const std::string_view &name) |
void | setSources (const std::string_view &sources) |
bool | load () |
void | unload () |
virtual void | exportClassToTree (nkExport::Node *rootNode) override |
virtual void | importClassFromTree (nkExport::Node *rootNode) override |
![]() | |
Exportable () | |
virtual | ~Exportable () |
Holds all information for a script.
The holder is also responsible for script compilation and usage within an environment.
nkScripts::Script::Script | ( | ) |
Constructor.
nkScripts::Script::~Script | ( | ) |
Destructor.
INTERPRETER nkScripts::Script::getScriptType | ( | ) | const |
std::string_view nkScripts::Script::getName | ( | ) | const |
std::string_view nkScripts::Script::getSources | ( | ) | const |
const CompilationResult& nkScripts::Script::getLastCompilationResult | ( | ) | const |
void nkScripts::Script::setScriptFor | ( | INTERPRETER | interpretType | ) |
Sets the interpreter this script should target.
interpretType | The type of interpreter the script should compile for. |
void nkScripts::Script::setName | ( | const std::string_view & | name | ) |
Sets the name of the script.
name | The name to assign. |
void nkScripts::Script::setSources | ( | const std::string_view & | sources | ) |
Sets the sources the script should compile from.
sources | The sources to assign. |
bool nkScripts::Script::load | ( | ) |
Loads the script. This triggers recompilation and prepares it for intepretation within the Environment.
void nkScripts::Script::unload | ( | ) |
Unloads and free all resources linked to compilation within the script.
|
overridevirtual |
Basic exporting capabilities.
rootNode | The root of the tree to export into. |
Implements nkExport::Exportable.
|
overridevirtual |
Basic importing capabilities.
rootNode | The root of the trree to import from. |
Implements nkExport::Exportable.